package com.huahai.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.huahai.pojo.dto.TeamJoinDTO;
import com.huahai.pojo.dto.TeamQueryDTO;
import com.huahai.pojo.dto.TeamUpdateDTO;
import com.huahai.pojo.entity.Team;
import com.huahai.pojo.entity.User;
import com.huahai.pojo.vo.TeamUserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author huahai
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2025-07-04 09:40:09
*/
public interface TeamService extends IService<Team> {

    /**
     * 创建队伍
     * @param team
     * @param loginUser
     * @return
     */
    Long saveTeam(Team team, User loginUser);

    /**
     * 根据查询参数查询队伍列表
     *
     * @param teamQueryDTO
     * @param isAdmin
     * @return
     */
    List<TeamUserVO> listTeams(TeamQueryDTO teamQueryDTO, boolean isAdmin, User loginUser);

    /**
     * 更新队伍信息
     * @param teamDTO
     * @param loginUser
     * @return
     */
    boolean updateTeam(TeamUpdateDTO teamDTO, User loginUser);

    /**
     * 加入队伍
     * @param teamJoinDTO
     * @param loginUser
     * @return
     */
    boolean joinTeam(TeamJoinDTO teamJoinDTO, User loginUser);

    /**
     * 用户退出队伍
     * @param id
     * @param loginUser
     * @return
     */
    boolean quitTeam(Long id, User loginUser);

    /**
     * 删除(解散)队伍
     * @param id
     * @param loginUser
     * @return
     */
    boolean removeTeam(Long id, User loginUser);
}
